package edu.mymvc.controller;

import edu.mymvc.common.R;
import edu.mymvc.entity.User;
import edu.mymvc.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.jws.soap.SOAPBinding;

@RestController
@RequestMapping("/user")
public class UserController {
    @Autowired
    IUserService iUserService;

    @GetMapping("{id}")
    public R getUserById(@PathVariable Long id){
        User user = iUserService.findById(id);
        return R.success(user);
    }
}
